#include "widget.h"
#include "ui_widget.h"

#include "wsystemtray.h"

#include <QDebug>
#include <QCloseEvent>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    setWindowFlag(Qt::Desktop);

    // 系统托盘初始化
    WSystemTray *ptray = new WSystemTray(this);
    ptray->showTray();
}

Widget::~Widget()
{
    delete ui;
    qDebug() << "quit program";
}

void Widget::closeEvent(QCloseEvent *event)
{
    this->hide();
    event->ignore();
}


